def process_data(data):
    parts = data.split(",")
    result = []
    for part in parts:
        if part:  # 处理可能的空字符串
            address = part[:16]
            size = part[16:32]
            mem_type = part[32:]
            # 翻转地址
            address_flipped = "".join([address[i:i+2] for i in range(14, -1, -2)])
            # 翻转大小
            size_flipped = "".join([size[i:i+2] for i in range(14, -1, -2)])
            # 翻转类型
            mem_type_flipped = "".join([mem_type[i:i+2] for i in range(6, -1, -2)])
            address_decimal = int(address_flipped, 16)
            size_decimal = int(size_flipped, 16)
            size_kb = size_decimal // 1024
            # 输出信息
            result.append(f"开始地址: 0x{address_flipped}, 数量: {hex(int(size_flipped, 16))}, 类型: {int(mem_type_flipped)}, 结束地址: {hex(address_decimal + size_decimal)}, 数量(KB): {size_kb}")
    return result


data =  "000000000000000000F009000000000001000000,00F009000000000000100000000000000200000\
0,00800E0000000000008001000000000002000000,00001000000000000000EF010000000001000\
000,0000FF0100000000000001000000000003000000,0000FCFF000000000000040000000000020\
00000,"

processed_data = process_data(data)
for line in processed_data:
    print(line)

